#!/bin/sh

if [ ! -d /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts ]; then
    echo "Missing directory, create it manually then try again:"
    echo "sudo mkdir -p /usr/lib/mozilla/native-messaging-hosts"
    exit 1
fi

cp "$SNAP/lib/native-messaging-host/firefox/org.jabref.jabref.json" /var/lib/snapd/hostfs/usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json
